package ui;


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;

public class Map {
    public static final int WIDTH = 800;
    public static final int HEIGHT = 600;
    static Random r = new Random();
    boolean[] visited;
    int[][] cities;
    public int nCities;

    public Map(int nCities) {
        this.nCities = nCities;
        cities = new int[nCities][];
        visited = new boolean[nCities];
    }
    
    public void save(String filename) throws Exception {
        PrintWriter out = new PrintWriter(new FileWriter(filename));
        out.close();
    }

    public static Map load(String filename) throws Exception {
        BufferedReader in = new BufferedReader(new FileReader(filename));
        String line = in.readLine().trim();
        int nCities = Integer.parseInt(line);
        Map map = new Map(nCities);
        for (int i=0; i<nCities; i++) {
            line = in.readLine();
            StringTokenizer st = new StringTokenizer(line);
            int x = Integer.parseInt(st.nextToken());
            int y = Integer.parseInt(st.nextToken());
            map.cities[i] = new int[]{x, y};
        }
        in.close();
        return map;
    }


}
